-
-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a space before "tree" in the "christmas" tree holiday reaction #1404
base: main
Are you sure you want to change the base?
Conversation
It's reacting to GitHub links that contain /tree/
Per discussion on Discord, it looks like we're okay still reacting to most trees, just not when they're in a link. |
Are we certain we don't mind most trees? A lot of trees can be stated that have no relation to the season itself. "Grinch's tree", sure, but then what about "skeleton tree"? That will still react with a tree; the regex matches, but that's for halloween. If we're going to activate it for Christmas, I'd rather you match for christmas/xmas then lookahead for tree. |
@@ -61,7 +61,7 @@ class Holiday(NamedTuple): | |||
} | |||
) | |||
Christmas = Holiday([Month.DECEMBER], { | |||
"christmas tree": Trigger(r"\b((christ|x)mas|tree)\b", ["\U0001F384"]), | |||
"christmas tree": Trigger(r"\b(christ|x)mas\s?(tree(s)?)?\b", ["\U0001F384"]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the parens around the s
for pluralizing "tree" are unnecessary, but it might be slightly more readable with them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think making the trees group optional makes this match on just "christmas".
is that a problem? a christmas tree seems to a good reaction for |
That's also the current behavior of the regex. |
In that case there's no point mentioning tree in the regex, it can just have the christmas bit |
Relevant Issues
This is one possible solution to #1403. I'll leave the floor open for discussion over other options.Looks like this is the solution that fits!
Closes #1403
Description
christmas|tree
->christmas| tree
to make sure that we only react to trees of the non-linked variety.regex101 screenshots
Did you: